/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("Recycled_Material_Ingredient_Record",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using ATkg.BizAppProject.DomainModels;
using ATkg.BizAppProject.IServices;
using Microsoft.AspNetCore.Authorization;

namespace ATkg.BizAppProject.Controllers
{
    public partial class Recycled_Material_Ingredient_RecordController
    {
        private readonly IRecycled_Material_Ingredient_RecordService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;

        [ActivatorUtilitiesConstructor]
        public Recycled_Material_Ingredient_RecordController(
            IRecycled_Material_Ingredient_RecordService service,
            IHttpContextAccessor httpContextAccessor
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
        }

        public class RecycledInfo
        {
            public string AllyTopId { get; set; }
            public string LotIdsStr { get; set; }
            public string ProductId { get; set; }
            public string ProductUomId { get; set; }
            public string LotId { get; set; }
            public string CreateDate { get; set; }
            public decimal ProductQty { get; set; }
        }

        [HttpPost("GetOutInfo")]
        [AllowAnonymous]
        public async Task<JsonResult> GetOutInfo()
        {

            object r;

            r = await Service.GetOutInfo();

            return JsonNormal(r);
        }

        [HttpPost("GetInputInfo")]
        [AllowAnonymous]
        public async Task<JsonResult> GetInputInfo()
        {

            object r;

            r = await Service.GetInputInfo();

            return JsonNormal(r);
        }

        [HttpPost("FillOutputLotIdAsync")]
        [AllowAnonymous]
        public async Task FillOutputLotIdAsync()
        {

            await Service.FillOutputLotIdAsync();

            return ;
        }
    }
}
